load('litter.Rdata')

Using 311 Data for the Application

We can utilize Baltimore’s latest 311 database to inform when to alert people when they are in litter “hot-spots”. This can be used to remind users of the game to be mindful of their trash, or to alert people that they are in areas where there are opportunities for big points!

Below, I have accessed the latest reports of a “Dirty Street” or “Dirty Alley” from the 311 database and created a heatmap over the city of Baltimore of the volume of reports by location in the city.

library(maps)
library(tidyverse)
library(ggmap)
md <- filter(map_data("state"), region == "maryland")
md_county <- filter(map_data("county"), region=="maryland")
bmore <- filter(md_county, subregion=="baltimore city")
lat.lim <- c(min(bmore$lat, na.rm=TRUE),
             max(bmore$lat, na.rm=TRUE))
lon.lim <- c(min(bmore$long, na.rm=TRUE),
             max(bmore$long, na.rm=TRUE))
bmore_map <-ggmap(get_stamenmap(bbox = c(left = lon.lim[1], bottom = lat.lim[1],
                                         right = lon.lim[2], top=lat.lim[2]),
                         zoom = 12, scale = 5,
                         maptype ='terrain',
                         color = 'color')) 
bmore_map +
  stat_density2d(data=litter.dat, mapping=aes(x=Longitude, y=Latitude, fill=..level..), alpha=0.1,
                 size=0.01, bins=100, geom="polygon") +
  labs(title="Heat Map of Baltimore 311 Dirty Street/Alley Reports",
       fill="Reports")

Data Collection from users

One of the primary purposes of the app will be to collect data from the users to gather even more information of areas that need cleaning up! The app will provide an easy way to report information similar to that displayed above, and more! In addition to reporting locations of dirty alleys or streets, the app will award points to users who identify the locations of trash cans and trash cans that are overflowing. A major feature of the app will be to notify users where trash cans are so that they can throw away their trash. Since this data is not easily accessible, it will be up to users to provide information for the app. Below I have reproduced the plot above, with a point for a trash can near JHSPH. The point can be colored based on whether the can is overflowing or not.

trash_cans <- data.frame(lat=c(39.299751,39.285668),
                         lon=c(-76.590883,-76.590464),
                         overflow=c("Not Overflowing","Overflowing"))
bmore_map +
  stat_density2d(data=litter.dat, mapping=aes(x=Longitude, y=Latitude, fill=..level..), alpha=0.1,
                 size=0.01, bins=100, geom="polygon") +
  geom_point(data=trash_cans, aes(x=lon, y=lat, color=overflow), shape=15) +
  scale_color_manual(values=c("green", "red")) +
  labs(title="Heat Map of Baltimore 311 Dirty Street/Alley Reports",
       color="Trash Cans",
       fill="Reports")

Liquor stores

Liquor container waste is a widely recognized contributor to municipal litter. In particular some communities have looked to ban single-serving liquor containers (https://www.telegram.com/news/20190609/communities-seek-ways-to-nip-liquor-bottle-litter-in-bud). With regard to litter, the City of Oakland has grouped liquor stores along with fast food businesses, convenience markets, and gasoline station markets, targeting all of them with an excess litter fee under Ordinance 12727 (https://www.oaklandca.gov/services/finance-dept-liens-and-excess-litter-fee).

Baltimore City makes available a data set describing liquor license granted to liquor stores from 2003 to 2018 (https://data.baltimorecity.gov/City-Services/Liquor-Stores/hew9-k3x4). It is unclear whether the data set is exhaustive, but it includes information on 4,148 licenses granted to 306 unique locations. Reported variables include licensee name, owner name, corporation name, license type, address, and geolocation.

What will be most useful for our app is the address and geolocation. With this information, we can monitor the link between garbage location and liquor store location, as well as send trash disposal reminders to customers exiting liquor stores. This data is not ideal because the locations may be out of date, but it is a good start.

require(ggmap)

liquor = read.csv('Liquor_Stores.csv')
liquor$coord = NA
liquor$lat = NA
liquor$lon = NA
for(i in 1:nrow(liquor)){
  liquor$coord[i] = strsplit(toString(liquor$Location.1[i],sep=''), 
                           "[[:digit:]]{5}[[:space:]][(]")[[1]][2]
if (!is.na(liquor$coord)[i]) {
  liquor$coord[i] = paste('(', liquor$coord[i], sep='')
  liquor$lat[i] = as.numeric(substring(strsplit(liquor$coord[i], ',')[[1]][1],first=2))
  liquor$lon[i] = as.numeric(substring(strsplit(liquor$coord[i], ',')[[1]][2], first=1, 
                                      last=nchar(strsplit(liquor$coord[i], ',')[[1]][2])-1))
  }
}


lat.lim <- c(min(liquor$lat, na.rm=TRUE),
             max(liquor$lat, na.rm=TRUE))
lon.lim <- c(min(liquor$lon, na.rm=TRUE),
             max(liquor$lon, na.rm=TRUE))
p <- ggmap(get_stamenmap(bbox = c(left = -76.72, bottom = 39.2,
                                  right = -76.5, top=39.4),
                         zoom = 12, scale = 5,
                         maptype ='terrain',
                         color = 'color'))
p = p+ geom_point(aes(x = lon, y = lat), data = liquor, size = 1, col='red')

p + ggtitle('Liquor store locations in Baltimore')

We may be interested in which corporations have been granted the most licenses, since we may reach out to them for coupon partnerships or for their support in trash management.

sort(table(liquor$CorpName),decreasing=TRUE)[1:10]
## 
##                               N/A                      READ'S, INC. 
##                               315                               147 
##                        BONA, INC.     EDDIE'S OF EAGER STREET, INC. 
##                                41                                41 
##          LEES FAMILY LIQUOR, INC.               ARIDNAR CORPORATION 
##                                41                                39 
##           ATLANTIC CATERERS, INC. BAY ISLAND SEAFOOD CARRYOUT, INC. 
##                                39                                39 
##                    CHI-SUNG, INC.            FIBUS DRUG STORE, INC. 
##                                39                                39

The data set has a “description” column, which contains only two levels.

pie(table(liquor$Description), main='Liquor store license description')

Some people have unique names which make them easy to find online, and therefore easy to contact. In fact, about 15% of the licenses were given to owners whose first names (for current purposes, defined as part of name before first space) do not appear in the R babynames dataset, which lists all names given to at least five babies in one year from 1880 to 2017 according to Social Security Administration records.

require(babynames)
## Loading required package: babynames
liquor$nameInCensus = NA
namesInCensus = toupper(unique(babynames$name))
for(i in 1:nrow(liquor)){
  name = ifelse(grepl('[[:space:]]', toString(liquor$LicenseeFirstName[i])),
                strsplit(toString(liquor$LicenseeFirstName[i]), '[[:space:]]')[[1]][1],
                toString(liquor$LicenseeFirstName[i]))
  liquor$nameInCensus[i] = name %in% namesInCensus
}
mean(liquor$nameInCensus)
## [1] 0.8519769

Here is President and COO of Northern Pharmacy, Pepper K. Mintz.

Product Plan

The product we are proposing is a mobile game application. The game would encourage users to engage with and provide data about litter “hot-spots” in Baltimore city. The app would award points for certain actions by the user.

  • Identifying trash cans (extra points for previously unidentified cans)
  • Identifying litter
  • Picking up existing litter
  • Throwing away own trash

These events will be confirmed by photograph and geolocation from the user’s phone. To identify a trash can, the user must send a photo from their location. This will mean there will have to be some machine learning training to identify valid trash cans from photos. The geolocation will be used to set the location of the trash can in the system. When picking up litter or throwing away trash, the user will have to send a photo of the action, and the action would have to occur near a identified trash can in the system. Points will be redeemable for eco-friendly products such as reusable water bottles and grocery bags. Users will also be able to organize into teams and compete for weekly prizes. Data will also be recorded for the top individuals and organizations over shor periods of time.

In order to build this app, we will need an algorithm to identify valid trash cans. This may be difficult, because trash cans can come in many shapes and sizes. Outside of this, the app’s infrastructure will be fairly simple. It will consist of a map of the city, geolocation data of spots with litter (curated from the 311 database and user input), geolocation data of trash can locations, and geolocation data of various types of buisinesses.

The target audience of the app will be the citizenry of Baltimore. It will be sustained by the support of businesses and organizations with a vested interest in the goal of the app: to curate data on litter in the city of Baltimore and to promote the citizenry to help keep these areas litter-free. We will ask local businesses and organizations to donate funding and goods that can be used as prizes (such as coupons to local establishments). The potential failures of the app will be a lack of interest or users. Another potential failure would be users trying to “game” the app by claiming they threw away trash when they really just left it on the ground. This is why the functionality of identifying user’s photos will be important.

In order to create and run the app for a year, we will need a small team of developers, server space for the data, and a team of partners to provide funding and prizes.

Estimates of cost

  • Server: $2,000
  • Developers: $100,000
  • Partnerships/Prizes: $23,000